package com.efast.cafe.commponent.statemach.service;

import java.util.List;

import javax.script.ScriptException;

import com.efast.cafe.portal.bean.company.PortalCompanyUserBean;
import com.efast.cafe.portal.bean.statemach.PortalStateMachConfBean;
import com.efast.cafe.portal.bean.statemach.PortalStateMachField;
import com.efast.cafe.portal.bean.statemach.PortalStateMachHandleBean;
import com.efast.cafe.portal.bean.statemach.PortalStateMachNoticeBean;
import com.efast.cafe.portal.bean.statemach.PortalStateMachStateBean;
import com.efast.cafe.commponent.statemach.bean.StateExtData;
import com.efast.cafe.portal.remote.statemach.PortalStateMachService;

public interface IPortalStateMachService extends PortalStateMachService{

	public PortalStateMachConfBean getPortalStateMachByConfId(Long confId);

	public void ChangeState(Long Id, Long stateId);

	public StateExtData GetStateExtDataByConfid(Long confId, Long stateId);

	public PortalStateMachStateBean getInitState(Long confId);

	public PortalStateMachStateBean getCurrentState(Long confId, Long stateId);

	public PortalStateMachHandleBean getExecHandle(List<PortalStateMachHandleBean> thisHandle, String json);

	boolean isLastState(Long confId, Long stateid);

	/**
	 * 获取要发送的消息配置
	 * @param confId
	 * @param changeState
	 * @param json
	 * @return
	 */
	List<PortalStateMachNoticeBean> getNoticeConfig(Long confId, Long changeState, String json);

	/**
	 * 根据通知配置获取人员
	 * @param ParaKey
	 * @param id
	 * @param companyCode
	 * @return
	 */
	PortalCompanyUserBean getCompanyUserBeanForNotice(String ParaKey, String id, String companyCode);
	
	/**
	 * 获取当前流程状态
	 * @param id
	 * @return
	 */
    Long getState(Long id);
    
    /**
	 * 根据流程和状态获取entity的display配置
	 * 
	 * @param confId
	 * @param stateId
	 * @param entityName
	 * @return
	 */
	List<PortalStateMachField> getFieldForStateMach(Long confId, Long stateId, String entityName);
	
}
